import random

#生成0~100的随机数
rand_date = random.uniform(0,100)
print(rand_date)

#获取时间并转换为时间戳
from datetime import datetime
now = datetime.now()
timestamp = now.timestamp()
print(now)
print(timestamp)

#在0~2**32之间生成随机数作为时间戳，并用datetime转换为日期
rand_time = random.uniform(0,2**32)
date = datetime.fromtimestamp(rand_time)
print(date)